package com.taobao.txc.a.c;

import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.b.b;
import com.taobao.txc.common.config.n;
import com.taobao.txc.common.config.o;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;

class c
  implements n
{
  private CountDownLatch b;
  private d c;
  private boolean d = false;
  
  private c(a parama, CountDownLatch paramCountDownLatch, d paramd)
  {
    this.b = paramCountDownLatch;
    this.c = paramd;
  }
  
  private synchronized List<String> b(String paramString)
  {
    if (this.d) {
      return null;
    }
    List localList = com.taobao.txc.common.util.c.g.a(paramString);
    if (localList != null)
    {
      Iterator localIterator = localList.iterator();
      while (localIterator.hasNext())
      {
        String str1 = (String)localIterator.next();
        String str2 = com.taobao.txc.common.util.c.g.b(str1);
        int i = -1;
        do
        {
          try
          {
            String str3 = o.a().a(str2, "TXC_GROUP", 5000L);
            if (str3 != null)
            {
              this.c.a(str1, str3);
              break;
            }
            if (a.a(this.a))
            {
              if (i == -1) {
                i = 5;
              }
              i--;
              a.b().info(String.format("get vip retry:%s", new Object[] { str1 }));
              try
              {
                Thread.sleep(500L);
              }
              catch (InterruptedException localInterruptedException1) {}
            }
          }
          catch (IOException localIOException)
          {
            a.b().error(b.a.bd, String.format("get vip failed:%s", new Object[] { str1 }));
            if (a.a(this.a))
            {
              if (i == -1) {
                i = 5;
              }
              i--;
              a.b().info(String.format("get vip retry:%s", new Object[] { str1 }));
              try
              {
                Thread.sleep(500L);
              }
              catch (InterruptedException localInterruptedException2) {}
            }
          }
        } while (i > 0);
        if (i == 0)
        {
          o.a().a(com.taobao.txc.a.b.g.f(), String.format("vip address not available [%s]", new Object[] { str1 }), 10, com.taobao.txc.a.b.g.c());
          a.b().error(b.A.bd, String.format("vip address not available, [%s]", new Object[] { str1 }));
        }
      }
      this.c.a(localList);
    }
    if (this.b.getCount() > 0L) {
      this.b.countDown();
    }
    return localList;
  }
  
  private synchronized void b()
  {
    this.d = true;
  }
  
  public Executor a()
  {
    return null;
  }
  
  public void a(String paramString)
  {
    b(paramString);
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.a.c.c
 * JD-Core Version:    0.7.0.1
 */